<?PHP 
session_start();
include("../config/connect.php");
require_once("../public/common.php");
require_once("../public/biaoqing.php");

$order = CheckUrlParamNoDie("order");
$id = CheckUrlParamNoDie("id");
$type = CheckUrlParamNoDie("t");
$user = CheckUrlParamNoDie("user");

if ($id=="")
{
	header("location:../tag");
	exit;
}
if ($order == "")
	$order = "m";

$g_tag = "";
$g_userid="";
$g_state=2;
if ($type == "kk")
{
	$sql = "select * from cache_items where id='$id' limit 1";
	$result = mysql_query( $sql );
	$row = mysql_fetch_assoc( $result );
}
else
{
	$sql = "select * from goods_items where id='$id' limit 1";
	$result = mysql_query( $sql );
	if(mysql_num_rows($result) == 0){
		header("location:../tag");
		exit; //退出以后，后面的就不解析
	}
	$row = mysql_fetch_assoc( $result );
	$g_tag=trim($row["tag"]);
	$g_userid=$row["user_id"];
	$g_state=$row["state"];
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="<?PHP 
$vecTag = explode(" ", $g_tag);
for ($i = 0; $i < count($vecTag); $i++)
{
	if (trim($vecTag[$i]) != "")
		echo "$vecTag[$i]";//.$g_HotKey[$i % count($g_HotKey)];
	if ($i < count($vecTag) - 1)	echo ",";
}
?>" /> 
<meta name="description" content="新潮有趣，奇特好玩的时尚女装购物社区。每天推荐网上最好看、最超值的衣服、鞋子、包包、配饰、化妆品、团购等时尚女装品牌；提供让您惊喜又惊讶，感叹又实用的商品。" /> 
<meta name="robots" content="index, follow" /> 
<meta name="googlebot" content="index, follow" />
<title>兔丝街 - <?PHP echo $row["item_title"]; ?></title>
<link type="text/css" rel="stylesheet" href="../css/base.css" />
<link type="text/css" rel="stylesheet" href="../css/shopping_street=20110716.css" />
<script language="javascript" src="../js/common.js"></script>
<style type="text/css">
.activityBar { margin-bottom:10px; overflow:hidden;}
.activityBar li { float:left;}
</style>
</head>
<body class="BabyStreet">
<div id="wrapper">
	<!---head kaishi--->
     <?php
	 //echo date("Y-m-j G:i:s");
	 	include("../dialog.php");
		include("../headtop.php"); 
	?>
    <!-----head 结束----->
	<div id="h_banner" style="margin:5px 0 10px 0;">
    	<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="950" height="120">
            <param name="movie" value="../images/itenbanner.swf">
            <param name="quality" value="high">
            <param name="wmode" value="transparent">
            <embed src="../images/itenbanner.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="950" height="120" wmode="transparent"></embed>
        </object>	
   	</div>
    <!----推荐商品 一 二 三级分类导航---->
    <?php
		//$catelog= urldecode(CheckUrlParamNoDie("cl"));
		//$cl_catelog = $catelog;
		//include("../goods.php"); 
	?>
    <!----推荐商品 导航结束---->
    <div id="main">
    	<div class="grid_12">
        	<!--产品详情-->
        	<div class="grid_9 alpha">
				<div class="singleGoods mt10" style="border-right:1px solid #dedede; background:#fff; display: block;">
					<div class="code_pic">
						<a target="_blank" href="<?PHP echo $row["url"]; ?>"><img src="<?PHP echo $row["pic_url"]."_250x250.jpg"; ?>" title="<?PHP echo $row["item_title"]; ?>"></a>
					</div>
					<div class="goodsdetail">
						<div class="gs_h">
							<h4 class="f16"><a class="goods_title" target="_blank" href="<?PHP echo $row["url"]; ?>"><?PHP echo $row["item_title"]; ?></a></h4>
                            <p class="price qz-price">淘宝价<em><?PHP echo $row["fee"]; ?></em>元<span <?php if(round(0.6*$row["commission"], 2) == ""){ echo 'style="display:none"';} ?> style="padding-left:40px;">&nbsp;<span class="coin">购物兔价</span><span class="fan">&nbsp;<?PHP echo ($row["fee"])-(round(0.6*$row["commission"], 2)); ?></span>元</span></p>
                            <p class="looklink"><a href="<?PHP echo $row["url"]; ?>" target="_blank">去淘宝购买</a><span <?php if(round(0.6*$row["commission"], 2) == ""){ echo 'style="display:none"';} ?> ><a href="javascript:void(0)" onclick="onGoGouwutu(<?php echo $row["num_iid"]; ?>)" style="margin-left:10px;">去购物兔购买</a></span></p>
                            <p <?php if ($type == "kk") echo "style='display:none;'"; ?> class="p12"><a class="notlikeit cursor" style="float:left;" onclick="onfavorite(<?PHP echo $id; ?>)">喜欢</a><b class="f14 red nums" style="float:left; <?php if ($row["favorite"] == 0) echo "display:none;"; ?> "  id="favorite_<?PHP echo $id; ?>" ><?PHP echo $row["favorite"]; ?></b></p>
                            <?php if($type != "kk" && $row["r_desc"] != "") {?> <p class="price Recommend" >推荐说：<span style="color:#666; font-size:12px;"><?PHP echo ReplaceBiaoQing($row["r_desc"]); ?></span></p><?PHP } ?>
                            <div style="margin-left:195px;">
                            	<!-- JiaThis Button BEGIN -->
                                <div id="ckepop">
                                    <span class="jiathis_txt left" style="line-height:16px; font-size:12px;">分享到：</span>
                                    <a class="qzone" href="http://www.jiathis.com/send/?webid=qzone&url=<?PHP echo urlencode("http://www.tusijie.com/item/share_page.php?id=".$row["id"]."&jtss=qzone"); ?>&title=<?PHP echo $row["item_title"]; ?>&pic=<?PHP echo $row["pic_url"]; ?>&uid=904300&jtss=qzone" target="_blank" title="分享到QQ空间"></a>
                                    <a class="tsina" href="http://www.jiathis.com/send/?webid=tsina&url=<?PHP echo urlencode("http://www.tusijie.com/item/share_page.php?id=".$row["id"]."&jtss=tsina"); ?>&title=<?PHP if($row["r_desc"] != ""){ echo $row["r_desc"]; }else{ echo $row["item_title"];} ?>&pic=<?PHP echo $row["pic_url"]; ?>&uid=904300" target="_blank" title="分享到新浪微博"></a>
                                    <a class="renren" href="http://www.jiathis.com/send/?webid=renren&url=<?PHP echo urlencode("http://www.tusijie.com/item/share_page.php?id=".$row["id"]."&jtss=renren"); ?>&title=<?PHP echo $row["item_title"]; ?>&pic=<?PHP echo $row["pic_url"]; ?>&uid=904300&jtss=renren" target="_blank" title="分享到人人网"></a>
                                    <a class="tqq" href="http://www.jiathis.com/send/?webid=tqq&url=<?PHP echo urlencode("http://www.tusijie.com/item/share_page.php?id=".$row["id"]."&jtss=tqq"); ?>&title=<?PHP if($row["r_desc"] != ""){ echo $row["r_desc"]; }else{ echo $row["item_title"];} ?>&pic=<?PHP echo $row["pic_url"]; ?>&uid=904300&jtss=tqq" target="_blank" title="分享到腾讯微博"></a>
                                </div>
                                <!-- JiaThis Button END -->
                          
                            </div>
						</div>
					</div>
                    <div class="clear"></div>
                    <?PHP
                    if ($g_tag!="")
					{
                    	echo "<div class='t_tag'>标签：";
						$vecTag = explode(" ", $g_tag);
						for ($i = 0; $i < count($vecTag); $i++)
							echo "<a target='_blank' href='../tag?tag=".urlencode($vecTag[$i])."'>$vecTag[$i]</a>";
                    	echo "</div>";
                    } ?>
                    <div class="clear"></div>
                </div><!-- goods -->
            </div>
            <!----猜你喜欢的其他宝贝--->
            <div class="grid_3 omega">
            	<h2 style="font-size: 14px; height: 34px; line-height: 32px; font-weight: bold;">兔达人的其它分享</h2>
				<ul class="guess">
                <?PHP
				function _RendItem($row)
				{
					global $g_state;
					$tmpTag = explode(" ", trim($row["tag"]));
					$tmpTag = $tmpTag[0];
					$tmpStr = "<li><a target='_blank' href='../item/?id=".$row["id"]."'><img src='".$row["pic_url"]."_90x90.jpg"."' title='' alt=''></a><span>";
					if ($g_state == 3)
						$tmpStr .= $tmpTag;
					else
						$tmpStr .= "<a target='_blank' href='../tag?tag=".urlencode($tmpTag)."'>$tmpTag</a>";
					
					$tmpStr .= "</span></li>";
					echo $tmpStr;
				}
				
				$limitCount = $g_state == 3 ? 4 : 6;
				if ($g_userid!="")
					$sql = "select * from goods_items where state=$g_state and id <> $id and user_id=$g_userid and datediff(now(), time)<30 order by rand(now()) limit $limitCount";
				else
					$sql = "select * from goods_items where state=$g_state and datediff(now(), time)<30 order by rand(now()) limit $limitCount";

				$k = 0;
				$res2 = mysql_query( $sql );
				while( $res2 && $row = mysql_fetch_assoc( $res2 ))
				{
					++$k;
					_RendItem($row);
				}
				
				// 补足到6
				if ($k < $limitCount)
				{
					$res2 = mysql_query( "select * from goods_items where state=$g_state and datediff(now(), time)<30 order by rand(now()) limit ".($limitCount-$k) );
					while( $res2 && $row = mysql_fetch_assoc( $res2 ))
						_RendItem($row);
				}
				?>
				</ul>
				<div class="clear"></div>
			</div>
            <!-----标题 最新 最热 列表 海报<a class='il_itemhref' href='?page=".($nPage-1)."$il_param'>------->
            <div style="border-top:1px solid #dedede; padding-bottom:10px; width:100%; overflow:hidden; clear:both;"></div>
            <div class="activityBar">
                <ul>
                    <li><a href="http://www.tusijie.com/zt"><img src="../activity/img/bar_20110825.gif" alt="" title="兔丝街开学季活动 大奖等你拿" /></a></li>
                    <li><a href="http://www.tusijie.com/activity/fx.php"><img src="../activity/img/bar_20110825bb.gif" alt="" title="分享达人有奖招募" width="185" /></a></li>
                </ul>
            </div>
            <div class="goodsTitle mt14">
                <ul class="">
                    <li <?php if ($user == "") echo "class='active'"; ?> ><a href="<?php echo "?id=$id&t=$type"; ?>" >猜您喜欢</a></li>
                    <?PHP if ($type=="") echo "<li ".($user != ""?"class='active'":"")."><a href='?id=$id&user=$g_userid'>兔达人的其它分享</a></li>";?>
                </ul>
            </div> 
            <!-----推荐内容------->
            <div>
                 <?PHP
				  $il_col = 4;
				  $il_param="&id=$id&t=$type&order=$order&user=$user";
				  $il_order=$order;
				  $il_tag=$g_tag;
				  $il_userid=$user;
				  $il_state=$g_state;

				  include("../itemlist.php"); 
				  ?>
            </div>
        </div>
    </div>
</div>

<!---网尾 kaishi--->
 <?php
     include("../networkend.php"); 
?>
<?php
     include("../scrolltop.php"); 
?>
<!-----网尾 结束----->
</body>
</html>

<script language="javascript">
function onGoGouwutu(id)
{
	var url = "http://www.tusijie.com/admin/get_item_info_simple.php?itemid=" + id;
	$.ajax({	url: url,
			async: false,
			success:function(res){
			var resObj = eval('(' + res + ')');
			if (resObj.code == 1)
				window.open("http://www.gouwutu.com/new/s/?id=" + id + "&ref=tsj_item&q=" + encodeURIComponent(resObj.title));
           }
		})
}
</script>

<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F22b7662ec7d02c816ddfd8f6df6e5cea' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-20984072-3']);
  _gaq.push(['_trackPageview']);
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>

<?PHP 
mysql_query( "update goods_items set hits=hits+1 where id=$id" );
?>